<template>
	<view class="pay-success">

		<view class="order-info">

			<view class="item no">
				<view class="name">订单编号</view>
				<view class="value">{{order.order_no}}</view>
			</view>

			<view class="item date">
				<view class="name">订单日期</view>
				<view class="value">{{order.create_time}}</view>
			</view>

			<view class="item payment">
				<view class="name">付款方式</view>
				<view class="value">{{order.payment_name}}</view>
				<!-- <view class="value">微信支付</view> -->
			</view>
			<!-- 暂时隐藏
	        <view class="item shipping">
	            <view class="name">配送方式</view>
	            <view class="value">{{order.shipping_name}}</view>
	        </view>
	-->
			<view class="item ">
				<view class="name">支付状态</view>
				<view v-show="order.is_payed==1" class="value">已支付</view>
				<view v-show="order.is_payed!=1" class="value">未支付</view>
			</view>

		</view>

		<view class="link">
			<navigator class="btn" open-type="switchTab" url="/sm_shop/pages/home/home">返回首页</navigator>
			<navigator class="btn" url="/sm_shop/pages/order/list">查看订单</navigator>
		</view>

	</view>
</template>

<script>
	const appInstance = getApp();
	export default {
		data() {
			return {
				order_id: 0,
				order: {

					order_no: '',
					create_time: '',
					payment_name: '',
					shipping_name: '',
					address_province: '',
					address_city: '',
					address_area: '',
					address_detail: '',
					is_payed: 0,
				}
			}
		},
		onLoad: function(options) {
			console.log(options)
			this.order_id = options.order_id;
			this.orderInfo();
		},

		methods: {
			orderInfo: function() {

				var url = '&r=checkout.order.info';
				var data = {
					order_id: this.order_id,
				};

				var t = this;
				appInstance.globalData.request(url, data, 'GET', res => {

					if (res.data.status == 0) {
						t.order = res.data.order;
					}

				});

			}
		}
	}
</script>

<style lang="less">
	@import './success.less';
</style>
